<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>Demo</title>
	<link rel="stylesheet" type="text/css" href="assets/kc-font-icon/iconfont.css" />
</head>
<style type="text/css">
	body,
	html,
	#allmap {
		width: 100%;
		height: 100%;
		overflow: hidden;
		margin: 0;
		font-family: "微软雅黑";
	}
</style>

<body>
	<div id="allmap" style="width:1200px;height: 800px;"></div>

</body>
<script type="text/javascript" src="js/lib/jquery-2.1.4.js"></script>
<script src="http://api.map.baidu.com/api?v=2.0&ak=34aeF8L8e9WEGxRleGYNy1MMpivtVgC1" type="text/javascript"></script>
<script>
	// 百度地图API功能
	var map = new BMap.Map("allmap");
	var point = new BMap.Point(113.875059, 22.571032);
	map.centerAndZoom(point, 15);
	var marker = new BMap.Marker(new BMap.Point(113.875059, 22.571032));
	map.addOverlay(marker);
	marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
	//    map.centerAndZoom("深圳市", 12);
	map.enableScrollWheelZoom(); //启用滚轮放大缩小，默认禁用
	map.enableContinuousZoom(); //启用地图惯性拖拽，默认禁用
	map.addControl(new BMap.NavigationControl()); //添加默认缩放平移控件
	map.addControl(new BMap.OverviewMapControl()); //添加默认缩略地图控件
	map.addControl(new BMap.OverviewMapControl({
		isOpen: true,
		anchor: BMAP_ANCHOR_BOTTOM_RIGHT
	})); //右下角，打开
	var localSearch = new BMap.LocalSearch(map);
	localSearch.enableAutoViewport(); //允许自动调节窗体大小
	function searchByStationName(titleName, coordinates, containerVal) {
		map.clearOverlays(); //清空原来的标注
		var coordinatesArr = new Array(); //定义一数组
		coordinatesArr = coordinates.split('|');
		var lng = coordinatesArr[0];
		var lat = coordinatesArr[1];
		var point = new BMap.Point(lng, lat); //创建点坐标
		map.centerAndZoom(point, 13); //初始化地图，设置中心点坐标和地图级别
		var marker = new BMap.Marker(new BMap.Point(lng, lat)); // 创建标注，为要查询的地方对应的经纬度
		map.addOverlay(marker);               // 将标注添加到地图中
		marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
		var contentArr = new Array(); //定义一数组
		contentArr = containerVal.split('|');
		var content = titleName + "<br/>";
		for (var i = 0; i < contentArr.length; i++) {
			content += "<br/>" + contentArr[i];
		}
		var infoWindow = new BMap.InfoWindow("<p style='font-size:14px;'>" + content + "</p>");
		marker.addEventListener("click", function () {
			this.openInfoWindow(infoWindow);
		});
	}

	setTimeout(function() {
		searchByStationName('河北办事处','114.479665|38.023067','地址：石家庄市桥西区新平街牡丹园2-1-2602室|手机：18931157123&nbsp;&nbsp;|座机：&nbsp;&nbsp;|传真：|E-mail：&quot;')
	}, 4000);
</script>
<textarea></textarea>  
<p>还可输入<span id="text-count"> 20  </span>个字</p>  
<script type="text/javascript">  
    /*字数限制*/  
    $("#area").on("input propertychange", function() {  
        var $this = $(this),  
            _val = $this.val(),  
            count = "";  
        if (_val.length > 20) {  
            $this.val(_val.substring(0, 20));  
        }  
        count = 20 - $this.val().length;  
        $("#text-count").text(count);  
	}); 
	$("#btnn").click(function(){
		console.log(333)
	}) 
</script> 

</html>